//
//  FSSettingCell.m
//  fanshu
//
//  Created by 刘开 on 16/4/5.
//  Copyright © 2016年 FS. All rights reserved.
//

#import "FSSettingCell.h"
#import "FSRow.h"
#import "FSArrow.h"

@implementation FSSettingCell

//创建一个cell
+(FSSettingCell *)cellwithWithTableView:(UITableView *)tableView
{
    static NSString *ID=@"settingcell";
    FSSettingCell*cell=[tableView dequeueReusableCellWithIdentifier:ID];
    if (cell ==nil) {
        cell=[[FSSettingCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];}
    return cell;
    
}

-(void)setRowItem:(FSRow *)rowItem{
    _rowItem =rowItem;
    
//    设置数据
    [self setData:rowItem];
//    设置辅助视图
    [self setAcc:rowItem];
    
}
//设置数据方法
-(void)setData:(FSRow *)rowItem

{
    self.imageView.image= rowItem.image;
    self.textLabel.text=rowItem.title;
}
//设置辅助视图

-(void)setAcc:(FSRow *)rowItem
{
    if ([rowItem isKindOfClass:[FSArrow class]]) {
        self.accessoryView= [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_arrow_next"]];
        
    }else {
        self.accessoryView=nil;
    }
    
}

@end
